{extend name="layout/detail" /}
{block name="content"}
<div class="td-content-wrap p20">
    <div class="td-content-header">
        <h1>购物设置</h1>
    </div>
    <hr>
    <div class="space-20"></div>
    <form id="form_data" class="layui-form" method="post">
        <input type="hidden" name="data_type" value="system">
        <div class="layui-form-item">
            <label class="layui-form-label w30">下单超时未付款可关闭订单时间：</label>
            <div class="layui-input-inline w6">
                <input type="text" class="layui-input" id="system_is_allow_close_order" name="system_is_allow_close_order" check="required"
                       info="标题"
                       value="{$system_data.system_is_allow_close_order|default=''}">
            </div>
            <div class="layui-input-inline w6">
                <div class="layui-form-mid">
                    小时
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label w30">到港前：</label>
            <div class="layui-input-inline w6">
                <input type="text" class="layui-input" id="system_before_arrive_port" name="system_before_arrive_port" check="required"
                       info="到港前"
                       value="{$system_data.system_before_arrive_port|default=''}">
            </div>
            <div class="layui-input-inline w20">
                <div class="layui-form-mid">
                    天付尾款
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label w30">物流自提协议：</label>
            <div class="layui-input-inline w40">
                <div class="file-upload">
                    <div class="input">
                        <input type="hidden" class="file-url" name="system_agreement"   value="{$system_data.system_agreement|default=''}">
                    </div>
                    <div class="file-upload-btn">
                        上传文件
                    </div>
                    <div class="file-list">
                    </div>
                </div>
            </div>
        </div>
        <hr>
        <div class="layui-form-item">
            <label class="layui-form-label"></label>
            <div class="layui-input-block">
                <a class="layui-btn" lay-submit="" lay-filter="demo2" onclick="save();">保存</a>
                <a class="layui-btn layui-btn-primary" onclick="go_return_url();">取消</a>
            </div>
        </div>
    </form>
</div>
{/block}

{block name="script"}
<script>
    layui.use(['common', 'uploader', 'element'], function () {
        var fn = {
            save: function () {
                send_form("form_data", "{:url('save')}", function (ret) {
                    if (ret.code) {
                        layer.msg(ret.msg, {
                            time: 1200
                        }, function () {
                            location.reload(true);
                        });
                    } else {
                        layer.msg(ret.msg);
                        return false;
                    }
                });
            }
        };
        win_exp(fn);
    });
</script>
{/block}